<!DOCTYPE html>
<html>
<head>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/jsp/common/mytags.jsp"%>
<title>单位信息</title>
<t:base type="jquery,dataTables"></t:base>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- extend -->
<script type="text/javascript">
$(function(){
	
	//var url = 'sys/ClientHouse/find?enable=0&clientId=' + parent._param_client_id;
	//_set_default_lable_text(url);
	
	$('#enterprise').dataTable({
		"bProcessing" : true, //DataTables载入数据时，是否显示‘进度’提示
        "bServerSide" : true, //是否启动服务器端数据导入
        "bStateSave" : false, //是否打开客户端状态记录功能,此功能在ajax刷新纪录的时候不会将个性化设定回复为初始化状态
        "bJQueryUI" : true, //是否使用 jQury的UI theme
        //"aLengthMenu" : [5, 10, 15], //更改显示记录数选项
        //"iDisplayLength" : 10, //默认显示的记录数
        "bAutoWidth" : true, //是否自适应宽度 update\
        "bScrollCollapse" : false, //是否开启DataTables的高度自适应，当数据条数不够分页数据条数的时候，插件高度是否随数据条数而改变
        "bPaginate" : false, //是否显示（应用）分页器
        "bInfo" : false, //是否显示页脚信息，DataTables插件左下角显示记录数
        "sPaginationType" : "full_numbers", //详细分页组，可以支持直接跳转到某页
        "bSort" : true, //是否启动各个字段的排序功能
        "aaSorting" : [[1, "DESC"]], //默认的排序方式，第3列，升序排列
        "bFilter" : false, //是否启动过滤、搜索功能
        "sScrollX": "100%",
		"sScrollXInner": 900,
        "sPaginationType": "full_numbers",
	    "sAjaxSource":"sys/ClientCar/list",
        "fnServerData":retrieveData,  //自定义数据获取函数
		"aoColumns" : [{
			"mDataProp" : "id",
			"sTitle" : "操作",
			"sDefaultContent" : "",
			"sClass" : "center",
			"sWidth":"100px",
			"mRender": function (data, display, row) {
				return top._set_default_href(row.id,top._local_default_query_opt);
				}
		},{
			"mDataProp" : "carBrand",
			"sTitle" : "车辆品牌",
			"bSortable": true,
			"sDefaultContent" : "",
			"sClass" : "center",
			"sWidth":"100px"
		}, {
			"mDataProp" : "carNumber",
			"sTitle" : "车牌号码",
			"sDefaultContent" : "",
			"sClass" : "center",
			"sWidth":"150px"
		},  {
			"mDataProp" : "carBuyTime",
			"sTitle" : "购买日期",
			"bSortable": true,
			"sDefaultContent" : "",
			"sClass" : "center",
			"sWidth":"150px",
			"mRender": function (data, display, row) {
				var value = '';
				if(_is_empty(data)){
					value = '';
				}else{
					value = new Date(data).format('yyyy-MM-dd');
				}
				
	            return value;
		     }
		},
		{
			"mDataProp" : "carBuyPrice",
			"sTitle" : "购买价格（元）",
			"sDefaultContent" : "",
			"sClass" : "center",
			"sWidth":"100px"
		},
		{
			"mDataProp" : "carBuyType",
			"sTitle" : "购买方式",
			"sDefaultContent" : "",
			"sClass" : "center",
			"sWidth":"100px",
			"mRender": function (data, display, row) {
				  if(!data){
					  return "";
				  }
			      return top.SYS_BASE_DATA['Client_Car_Buy_Type_Code'][data];
				}
		}
		
		],
		"oLanguage": {
            "sUrl":"static_resources/language/lang-cn.txt" //这个是国际化，也就是汉化的各种文字数据源，写对url就行了
        }
	});
	
	
	});
	var gotoBack = function(){
		top._do_goto_right('jsp/loan/applyLoanList_.jsp');
	};
	
	var default_query = function(id){
		var aData = $('#enterprise').dataTable().fnGetData();
		$.each(aData,function(index,node){
			if(node.id==id){
				//$('#_form_default').form('load',node);
				_set_default_lable_text('',true,node);
				return;
			}
		});
};
	//自定义数据获取函数
	var retrieveData = function( sSource, aoData, fnCallback ) {
		       aoData.push({name:'beanProxy[enable]',value:0});
		       aoData.push({name:'beanProxy[clientId]',value:parent._param_client_id});
		       aoData.push({name:'isNonPage',value:1});
		        $.ajax( {
		                type: "POST", 
		                url: sSource, 
		                cache : false,
		                dataType : "json",
		                data : aoData, 
		                success: function(resp) {
		                	if(resp && resp.state == 200){
		                		fnCallback(resp.datagrid);
		                		return false;
		                	}
		                	fnCallback(null);
		            }
		        });
	};
</script>
</head>

<body>
<div class="formbody">
	<div class="formtitle"><span>车辆信息列表</span></div>
	<table cellpadding="0" cellspacing="0" border="0" class="tablelist" id="enterprise" width="100%"></table>
		

	<div id="client_car">
		<div class="formtitle"><span>车辆信息详情</span></div>
		<form id="" name="">
			<ul class="forminfo">
				<li>
					<table class="newtablelist" id="">
				        <tbody>
					        <tr>
						        <td class="newtd">车辆品牌</td>
						        <td><span name="carBrand"></span>&nbsp;</td>
						        <td class="newtd">车牌号码</td>
						        <td><span name="carNumber"></span>&nbsp;</td>
						        <td class="newtd">购买日期</td>
						        <td><span name="carBuyTime@[yyyy-MM-dd]"></span>&nbsp;</td>
						    </tr>
						    <tr>
						        <td class="newtd">购买价格（元）</td>
						        <td><span name="carBuyPrice"></span>&nbsp;</td>
						        <td class="newtd">购车类型</td>
						        <td><span name="carType@Client_Car_Type_Code"></span>&nbsp;</td>
						        <td class="newtd">购买方式</td>
						        <td><span name="carBuyType@Client_Car_Buy_Type_Code"></span>&nbsp;</td>
						    </tr>
						    <tr>
						        <td class="newtd">月供贷款（元）</td>
						        <td><span name="carMonthly"></span>&nbsp;</td>
						        <td class="newtd">贷款总额（元）</td>
						        <td><span name="carLoanTotal"></span>&nbsp;</td>
						        <td class="newtd">尚欠余额（元）</td>
						        <td><span name="carLoanDebt"></span>&nbsp;</td>
						    </tr>
						    <tr>
						        <td class="newtd">按揭银行</td>
						        <td><span name="carBank"></span>&nbsp;</td>
						        <td class="newtd">贷款年限</td>
						        <td><span name="carLoanYear"></span>&nbsp;</td>
						        <td class="newtd">购买保险情况</td>
						        <td><span name="carInsureStatus@Client_Car_Insure_Status_Code"></span>&nbsp;</td>
						    </tr>
						    <tr>
						        <td class="newtd">保险类型</td>
						        <td><span name="carInsureType"></span>&nbsp;</td>
						        <td class="newtd">投保金额（元）</td>
						        <td><span name="carInsureMoney"></span>&nbsp;</td>
						        <td class="newtd">评估价值（元）</td>
						        <td><span name="carPrice"></span>&nbsp;</td>
						    </tr>
						    <tr>
						        <td class="newtd">车况描述</td>
						        <td colspan="5"><span name="carRemark"></span>&nbsp;</td>
						   	</tr>
						</tbody>
					</table>
				</li>
				<li><input name="" type="button"  onclick="history.go(-1);" class="scbtn" value="返回"/></li>
			</ul>
		</form>
	</div>
</div>
</body>
</html>
